﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Com.Charence.PassManager.Common.Extensions;
using Com.Charence.PassManager.BusinessEntities.Account;
using Com.Charence.PassManager.UI.Web.Common;
using Com.Charence.PassManager.UI.Web.Models;
using Com.Charence.PassManager.BusinessComponents;

namespace Com.Charence.PassManager.UI.Web.Controllers
{
    public class AccountController : BaseController
    {
        //
        // GET: /Account/

        public ActionResult Add()
        {
            return View();
        }

        public ActionResult NewSecureQuestion(int questionNumber)
        {
            return PartialView(questionNumber);
        }

        public ActionResult NewProperty(int propNumber)
        {
            return PartialView(propNumber);
        }

        [HttpPost]
        [JsonConverter(ParameterName="request", ParameterType=typeof(SaveAccountRequest))]
        public ActionResult SaveNewAccount(SaveAccountRequest request)
        {
            var bc = new AccountBC();
            bc.SaveNewAccount(request);

            return null;
        }

        public ActionResult AccountGrid(string keywords)
        {
            var bc = new AccountBC();
            var accountList = bc.GetAccountGrid(keywords);
            return View(accountList);
        }
    }
}
